package cn.lgwen.candy.runtime.operator;

import java.util.UUID;

/**
 * 2019/12/24
 * aven.wu
 * danxieai258@163.com
 */
public abstract class AbstractOperator implements Operator {

    protected String uid;

    protected boolean checkpoint = false;

    @Override
    public String uid() {
        if (uid == null) {
            uid = UUID.randomUUID().toString();
        }
        return uid;
    }

    @Override
    public void checkpoint(boolean checkpoint) {
        this.checkpoint = checkpoint;
    }
}
